package com.bytenerd.jianmu.model.enums;

import lombok.Getter;

@Getter
public enum RoleEnum {
    USER("用户","user"),
    ADMIN("管理员","admin"),
    VIP("VIP用户","vip");

    private final String text;

    private final String value;

    RoleEnum(String text, String value) {
        this.text = text;
        this.value = value;
    }

    public static RoleEnum getByValue(String value) {
        for (RoleEnum item : RoleEnum.values()) {
            if (item.value.equals(value)) {
                return item;
            }
        }
        return null;
    }
}
